/*
Copyright (c) [2019] [name of copyright holder]
[Software Name] is licensed under the Mulan PSL v1.
You can use this software according to the terms and conditions of the Mulan PSL v1.
You may obtain a copy of Mulan PSL v1 at:
	http://license.coscl.org.cn/MulanPSL
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
PURPOSE.
See the Mulan PSL v1 for more details.
*/

#pragma once


#include "节点/节点.h"
#include "../C_矢量插座.h"

#include <向量.h>
#include <矩阵.h>

#include <矩阵计算.h>
//#include <线性代数/矢量计算.h>







class C_Vec2_1D插座 : public C_插座基类 {
	S_Vec2Array* m_默认值;
	S_Vec2Array* m_转换值;
public:
	C_Vec2_1D插座(std::u16string name);
	~C_Vec2_1D插座();

	S_Vec2Array*	m_Value;

	void*		f_getDefaultData() { return m_默认值; }
	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);
	void		f_绑定指针(void* data);
	bool		f_接入插座是否匹配(E_值类型 type);
	
	std::string	f_构建变量代码(int32 loc);
	void		f_upGPU块(uint8 线程ID, bool 更新 = false);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[vec2]"; }
private:

};
#define DEF_Vec2_1D插座(socket) dynamic_cast<C_Vec2_1D插座*>( (socket) )
#define DEF_Vec2插座_1D数据(socket) ((S_Vec2Array*)((socket)->f_getData((0))))

#define DEF_创建Vec2_1D插座_I(name) socket = new C_Vec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Vec2_1D插座_O(name) socket = new C_Vec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);





class C_iVec2_1D插座 : public C_插座基类 {
	S_iVec2Array* m_默认值;
	S_iVec2Array* m_转换值;
public:
	C_iVec2_1D插座(std::u16string name);
	~C_iVec2_1D插座();

	S_iVec2Array*	m_Value;

	void*		f_getDefaultData() { return &m_默认值; }

	S_GPU内存块& f_getGPU块(uint8 线程ID, bool 更新 = false);
	S_GPU内存块& f_downGPU块(uint8 线程ID, bool 更新 = false);

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);
	void		f_绑定指针(void* data);
	bool		f_接入插座是否匹配(E_值类型 type);

	std::string	f_构建变量代码(int32 loc);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[ivec2]"; }
private:

};
#define DEF_iVec2插座_1D(socket) dynamic_cast<C_Vec2_1D插座*>( (socket) )
#define DEF_iVec2插座_1D数据(socket) ((S_iVec2Array*)((socket)->f_getData((0))))

#define DEF_创建iVec2_1D插座_I(name) socket = new C_iVec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建iVec2_1D插座_O(name) socket = new C_iVec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);




class C_uVec2_1D插座 : public C_插座基类 {
	S_uVec2Array* m_默认值;
	S_uVec2Array* m_转换值;
public:
	C_uVec2_1D插座(std::u16string name);
	~C_uVec2_1D插座();

	S_uVec2Array*	m_Value;

	void*		f_getDefaultData() { return m_默认值; }
	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);
	bool		f_接入插座是否匹配(E_值类型 type);

	std::string	f_构建变量代码(int32 loc);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[uvec2]"; }
private:

};
#define DEF_uVec2插座_1D(socket) dynamic_cast<C_uVec2_1D插座*>( (socket) )
#define DEF_uVec2插座_1D数据(socket) ((S_uVec2Array*)((socket)->f_getData((0))))

#define DEF_创建uVec2_1D插座_I(name) socket = new C_uVec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建uVec2_1D插座_O(name) socket = new C_uVec2_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);




class C_Vector1D_Vec3插座 : public C_插座基类 {
	vec3	m_默认值;
public:
	C_Vector1D_Vec3插座(std::u16string name);
	~C_Vector1D_Vec3插座();

	std::vector<vec3>				m_Value;

	void*			f_getData(uint8 线程ID);
	std::vector<vec3>*	f_getVec3_1D(const int64& ID = -1, uint8 线程ID = 0);
	void			f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	void		f_resize(uint32 size);
	void		f_reset();
	void		f_释放数据();

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[vec3]"; }
};
#define DEF_转换为arrayVec3插座(socket) dynamic_cast<C_Vector1D_Vec3插座*>( (socket) )
#define DEF_Vec3_Array1D插座数据(socket) ((std::vector<vec3>*)(dynamic_cast<C_Vector1D_Vec3插座*>( (socket) )->f_getData(0)))

#define DEF_创建Vec3_Array1D插座_I(name)  socket = new C_Vector1D_Vec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Vec3_Array1D插座_O(name)  socket = new C_Vector1D_Vec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);

#define DEF_Vec3p_CP_Vec3p(t, s) *((vector<vec3>*)(t)) = *((vector<vec3>*)s)





class C_Vec3_1D插座 : public C_插座基类 {
	S_Vec3Array* m_默认值;
	S_Vec3Array* m_转换值;
public:
	C_Vec3_1D插座(std::u16string name);
	~C_Vec3_1D插座();

	S_Vec3Array*	m_Value;

	S_GPU内存块& f_getGPU块(uint8 线程ID, bool 更新 = false);
	S_GPU内存块& f_downGPU块(uint8 线程ID, bool 更新 = false);
	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	void        f_Copy(const C_插座基类* node);
	std::u16string		f_getTypeName() { return u"[vec3]"; }

	cpp友员 C_Vec3_1D插座;
};
#define DEF_Vec3Array插座(socket) dynamic_cast<C_Vec3_1D插座*>( (socket) )
#define DEF_Vec3插座_1D数据(socket) ((S_Vec3Array*)(( (socket) )->f_getData(0)))

#define DEF_创建Vec3_1D插座_I(name)  f_add插座(new C_Vec3_1D插座( (name) ), E_插座方向::e_插座Type_输入);
#define DEF_创建Vec3_1D插座_O(name)  f_add插座(new C_Vec3_1D插座( (name) ), E_插座方向::e_插座Type_输出);




class C_Vec4_1D插座 : public C_插座基类 {
	S_Vec4Array* m_默认值;
	S_Vec4Array* m_转换值;
public:
	C_Vec4_1D插座(std::u16string name);
	~C_Vec4_1D插座();

	S_Vec4Array* m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	std::u16string		f_getTypeName() { return u"[vec4]"; }
};
#define DEF_Vec4_1D插座(socket) dynamic_cast<C_Vec4_1D插座*>( (socket) )
#define DEF_Vec4插座_1D数据(socket) ((S_Vec4Array*)(( (socket) )->f_getData(0)))

#define DEF_创建Vec4_1D插座_I(name)  socket = new C_Vec4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Vec4_1D插座_O(name)  socket = new C_Vec4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);




class C_iVec3_1D插座 : public C_插座基类 {
	//vec3 m_默认值_用于插座;
	S_iVec3Array* m_默认值;
	S_iVec3Array* m_转换值;
public:
	C_iVec3_1D插座(std::u16string name);
	~C_iVec3_1D插座();

	S_iVec3Array* m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	void        f_Copy(const C_插座基类* node);
	std::u16string f_getTypeName() { return u"[ivec3]"; }

	cpp友员 C_iVec3_1D插座;
};
#define DEF_iVec3Array插座(socket) dynamic_cast<C_iVec3_1D插座*>( (socket) )
#define DEF_iVec3插座_1D数据(socket) ((S_iVec3Array*)(( (socket) )->f_getData(0)))

#define DEF_创建iVec3_1D插座_I(name)  socket = new C_iVec3_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建iVec3_1D插座_O(name)  socket = new C_iVec3_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);





class C_iVec4_1D插座 : public C_插座基类 {
	//vec3 m_默认值_用于插座;
	S_iVec4Array* m_默认值;
	S_iVec4Array* m_转换值;
public:
	C_iVec4_1D插座(std::u16string name);
	~C_iVec4_1D插座();

	S_iVec4Array* m_Value;

	void* f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	void        f_Copy(const C_插座基类* node);
	std::u16string f_getTypeName() { return u"[ivec4]"; }

	cpp友员 C_iVec3_1D插座;
};
#define DEF_iVec4Array插座(socket) dynamic_cast<C_iVec4_1D插座*>( (socket) )
#define DEF_iVec4插座_1D数据(socket) ((S_iVec4Array*)(( (socket) )->f_getData(0)))

#define DEF_创建iVec4_1D插座_I(name)  socket = new C_iVec4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建iVec4_1D插座_O(name)  socket = new C_iVec4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);




class C_iVec3_2D插座 : public C_插座基类 {
	S_iVec3Array2D* m_默认值;
	S_iVec3Array2D* m_转换值;
public:
	C_iVec3_2D插座(std::u16string name);
	~C_iVec3_2D插座();

	S_iVec3Array2D* m_Value;

	void* f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	void        f_Copy(const C_插座基类* node);
	std::u16string f_getTypeName() { return u"[ [ivec3] ]"; }

	cpp友员 C_iVec3_2D插座;
};
#define DEF_iVec3Array2D插座(socket) dynamic_cast<C_iVec3_2D插座*>( (socket) )
#define DEF_iVec3插座_2D数据(socket) ((S_iVec3Array2D*)(( (socket) )->f_getData(0)))

#define DEF_创建iVec3_2D插座_I(name)  socket = new C_iVec3_2D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建iVec3_2D插座_O(name)  socket = new C_iVec3_2D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);





class C_Vec3_2D插座 : public C_插座基类 {
	S_Vec3Array2D* m_默认值;
	S_Vec3Array2D* m_转换值;
public:
	C_Vec3_2D插座(std::u16string name);
	~C_Vec3_2D插座();

	S_Vec3Array2D* m_Value;

	void* f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	std::string	f_构建变量代码(int32 loc);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);
	void        f_Copy(const C_插座基类* node);
	std::u16string f_getTypeName() { return u"[ [vec3] ]"; }

	cpp友员 C_Vec3_2D插座;
};
#define DEF_Vec3Array2D插座(socket) dynamic_cast<C_Vec3_2D插座*>( (socket) )
#define DEF_Vec3插座_2D数据(socket) ((S_Vec3Array2D*)(( (socket) )->f_getData(0)))

#define DEF_创建Vec3_2D插座_I(name)  socket = new C_Vec3_2D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Vec3_2D插座_O(name)  socket = new C_Vec3_2D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);









class C_Quat_1D_插座 : public C_插座基类 {
public:
	C_Quat_1D_插座(std::u16string name);
	~C_Quat_1D_插座();

	std::vector<S_Quat>				m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);
	
	void		f_释放数据();

	std::u16string		f_getTypeName() { return u"[quat]"; }
};
#define DEF_Quat_1D插座(socket) dynamic_cast<C_Quat_1D_插座*>( (socket) )
#define DEF_Quat_1D插座数据(socket) (std::vector<Quat>*)(DEF_Quat_1D插座( (socket) )->f_getData(0))

#define DEF_创建Quat_1D插座_I(name)  socket = new C_Quat_1D_插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Quat_1D插座_O(name)  socket = new C_Quat_1D_插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);









class C_Vec球_1D_插座 : public C_插座基类 {
public:
	C_Vec球_1D_插座(std::u16string name);
	~C_Vec球_1D_插座();

	std::vector<S_Sphere>	m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);
	void	f_释放数据();

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[sphere]"; }
};
#define DEF_VecSphere_1D_插座(socket) dynamic_cast<C_Vec球_1D_插座*>( (socket) )
#define DEF_VecSphere_1D插座数据(socket) (std::vector<S_Sphere>*)((socket)->f_getData(0))

#define DEF_创建VecSphere_1D_插座_I(name)  socket = new C_Vec球_1D_插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建VecSphere_1D_插座_O(name)  socket = new C_Vec球_1D_插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);











class C_Array1D_iVec3插座 : public C_插座基类 {
public:
	C_Array1D_iVec3插座(std::u16string name);
	~C_Array1D_iVec3插座();

	std::vector<ivec3>	m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);
	
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[ivec3]"; }
};
#define DEF_转换为Array_iVec3插座(socket) dynamic_cast<C_Array1D_iVec3插座*>( (socket) )
#define DEF_转换为Array_iVec3插座数据(socket) (std::vector<ivec3>*)( (socket)->f_getData(0) )

#define DEF_创建iVec3_Array1D插座_I(name)  socket = new C_Array1D_iVec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建iVec3_Array1D插座_O(name)  socket = new C_Array1D_iVec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);










class C_Array1D_uVec3插座 : public C_插座基类 {
public:
	C_Array1D_uVec3插座(std::u16string name);
	~C_Array1D_uVec3插座();

	std::vector<uvec3>	m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);
	
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[uvec3]"; }
};
#define DEF_uVec3_Array1D插座(socket) dynamic_cast<C_Array1D_uVec3插座*>( (socket) )
#define DEF_uVec3_Array1D插座数据(socket) (vector<uvec3>*)(DEF_uVec3_Array1D插座( (socket) )->f_getData(0))

#define DEF_uVec3_Array1D插座创建_I(name)  socket = new C_Array1D_uVec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_uVec3_Array1D插座创建_O(name)  socket = new C_Array1D_uVec3插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);















class C_面顶点索引插座 : public C_插座基类 {
	
public:
	C_面顶点索引插座(std::u16string name);
	~C_面顶点索引插座();

	std::vector<std::vector<uint32>>				m_Value;


	void		f_update(C_插座基类* 连接到的输入节点, class C_节点基类* node);

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);

	void		f_resize(uint32 size);
	void		f_释放数据();


private:

};
#define DEF_转换为面顶点索引插座(socket) dynamic_cast<C_面顶点索引插座*>( (socket) )
#define DEF_转换为面顶点索引插座数据(socket) (vector<vector<uint32>>*)(dynamic_cast<C_面顶点索引插座*>( (socket) )->f_getData(0))

#define DEF_面顶点索引插座创建_I(name)  socket = new C_面顶点索引插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_面顶点索引插座创建_O(name)  socket = new C_面顶点索引插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);

#define DEF_顶点索引p_CP_顶点索引p(t, s) *((vector<vector<uint32>>*)(t)) = *((vector<vector<uint32>>*)s)







class C_Array1D_Mat4X4插座 : public C_插座基类 {

public:
	C_Array1D_Mat4X4插座(std::u16string name);
	~C_Array1D_Mat4X4插座();

	std::vector<Mat44f>				m_Value;


	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);

	void		f_释放数据();

	std::u16string		f_getTypeName() { return u"[mat44]"; }
	bool		f_接入插座是否匹配(E_值类型 type);
	//void		f_读取(FILE* f);
	//void		f_写入(FILE* f);
};
#define DEF_Mat44_Array1D插座(socket) dynamic_cast<C_Array1D_Mat4X4插座*>( (socket) )
#define DEF_Mat44_Array1D插座数据(socket, loc) (std::vector<Mat44f>*)((socket)->f_getData(loc) )

#define DEF_创建Mat4X4_Array1D插座_I(name)  socket = new C_Array1D_Mat4X4插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Mat4X4_Array1D插座_O(name)  socket = new C_Array1D_Mat4X4插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_Mat4X4_1D插座 : public C_插座基类 {
	S_Mat44Array* m_默认值;
	S_Mat44Array* m_转换值;
public:
	C_Mat4X4_1D插座(std::u16string name);
	~C_Mat4X4_1D插座();

	S_Mat44Array*	m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);
	std::string	f_构建变量代码(int32 loc);

	std::u16string	f_getTypeName() { return u"[mat44]"; }
	bool			f_接入插座是否匹配(E_值类型 type);
	
};
#define DEF_Mat44_1D插座(socket) dynamic_cast<C_Mat4X4_1D插座*>( (socket) )
#define DEF_Mat44插座_1D数据(socket, loc) (S_Mat44Array*)((socket)->f_getData(loc) )

#define DEF_创建Mat4X4_1D插座_I(name)  socket = new C_Mat4X4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Mat4X4_1D插座_O(name)  socket = new C_Mat4X4_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_变换插座_Array1D : public C_插座基类 {

public:
	C_变换插座_Array1D(std::u16string name);
	~C_变换插座_Array1D();

	std::vector<S_Tranform>		m_Value;


	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, int64 ID = -1, uint8 线程ID = 0);
	void	f_释放数据();

	std::u16string	f_getTypeName() { return u"[变换]"; }
	//void		f_读取(FILE* f);
	//void		f_写入(FILE* f);
};
#define DEF_变换_1D插座(socket) dynamic_cast<C_变换插座_Array1D*>( (socket) )
#define DEF_变换_1D插座数据(socket, loc) (std::vector<S_Tranform>*)((socket)->f_getData(loc) )

#define DEF_创建变换_1D插座_I(name)  socket = new C_变换插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建变换_1D插座_O(name)  socket = new C_变换插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);








class C_Rect32f_Array1D插座 : public C_插座基类 {
	
public:
	C_Rect32f_Array1D插座(std::u16string name);
	~C_Rect32f_Array1D插座();

	std::vector<S_Rect2Df>		m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);

	void		f_resize(uint32 size);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[rectf]"; }
};
#define DEF_Rect32f_Array1D插座(socket) dynamic_cast<C_Rect32f_Array1D插座*>( (socket) )
#define DEF_Rect32f_Array1DValue(socket, tid) ((std::vector<S_Rect2Df>*)((socket)->f_getData((tid))))

#define DEF_Rect32f_Array1D_插座创建_I(name) socket = new C_Rect32f_Array1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_Rect32f_Array1D_插座创建_O(name) socket = new C_Rect32f_Array1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);










class C_Cube_1D插座 : public C_插座基类 {

public:
	C_Cube_1D插座(std::u16string name);
	~C_Cube_1D插座();

	std::vector<S_Cube>		m_Value;

	void*		f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);

	void		f_resize(uint32 size);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[cube]"; }
};
#define DEF_Cube_1D插座(socket) dynamic_cast<C_Cube_1D插座*>( (socket) )
#define DEF_Cube_1D插座数据(socket) ((std::vector<S_Cube>*)((socket)->f_getData((0))))

#define DEF_创建Cube_1D插座_I(name) socket = new C_Cube_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Cube_1D插座_O(name) socket = new C_Cube_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_线段插座_Array1D : public C_插座基类 {
	vec3	m_默认值;
public:
	C_线段插座_Array1D(std::u16string name);
	~C_线段插座_Array1D();

	std::vector<S_线段>				m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	void	f_释放数据();

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[line]"; }
};

#define DEF_线段_1D插座(socket) dynamic_cast<C_线段插座_Array1D*>( (socket) )
#define DEF_线段_1D插座数据(socket) ((std::vector<S_线段>*)(dynamic_cast<C_线段插座_Array1D*>( (socket) )->f_getData(0)))

#define DEF_创建线段_1D插座_I(name)  socket = new C_线段插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建线段_1D插座_O(name)  socket = new C_线段插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_VN插座_Array1D : public C_插座基类 {
	vec3	m_默认值;
public:
	C_VN插座_Array1D(std::u16string name);
	~C_VN插座_Array1D();

	std::vector<S_VN>				m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);

	void	f_释放数据();

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[VN]"; }
};

#define DEF_VN_1D插座(socket) dynamic_cast<C_VN插座_Array1D*>( (socket) )
#define DEF_VN_1D插座数据(socket) ((std::vector<S_VN>*)((socket)->f_getData(0)))

#define DEF_创建VN_1D插座_I(name)  socket = new C_VN插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建VN_1D插座_O(name)  socket = new C_VN插座_Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);




class C_包围盒插座1D : public C_插座基类 {
	S_CubeArray* m_默认值;
	S_CubeArray* m_转换值;
public:
	C_包围盒插座1D(std::u16string name);
	~C_包围盒插座1D();

	S_CubeArray*	m_Value;

	void*	f_getData(uint8 线程ID);
	void	f_setData(void* data, uint8 线程ID = 0);
	

	std::string	f_构建变量代码(int32 loc);

	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string f_getTypeName() { return u"[包围盒]"; }
};

#define DEF_包围盒1D插座(socket) dynamic_cast<C_包围盒插座1D*>( (socket) )
#define DEF_包围盒插座1D数据(socket) ((S_CubeArray*)((socket)->f_getData(0)))

#define DEF_创建包围盒_1D插座_I(name) f_add插座(new C_包围盒插座1D( (name) ), E_插座方向::e_插座Type_输入);
#define DEF_创建包围盒_1D插座_O(name) f_add插座(new C_包围盒插座1D( (name) ), E_插座方向::e_插座Type_输出);






//=============================================== 废弃 =========================================================

class C_Vector1D_Vec2插座 : public C_插座基类 {

public:
	C_Vector1D_Vec2插座(std::u16string name);
	~C_Vector1D_Vec2插座();

	std::vector<vec2>	m_Value;

	void* f_getData(uint8 线程ID);
	void		f_setData(void* data, uint8 线程ID = 0);
	bool		f_接入插座是否匹配(E_值类型 type);
	void		f_resize(uint32 size);
	std::string	f_构建变量代码(int32 loc);

	void		f_读取(FILE* f);
	void		f_写入(FILE* f);

	std::u16string		f_getTypeName() { return u"[vec2]"; }
private:

};
#define DEF_转换为arrayVec2插座(socket) dynamic_cast<C_Vector1D_Vec2插座*>( (socket) )
#define DEF_Vec2_Array1D插座数据(socket) ((std::vector<vec2>*)((socket)->f_getData((0))))

#define DEF_创建Vec2_Array1D插座_I(name) socket = new C_Vector1D_Vec2插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建Vec2_Array1D插座_O(name) socket = new C_Vector1D_Vec2插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);

#define DEF_Vec2p_CP_Vec2p(t, s) *((vector<vec2>*)(t)) = *((vector<vec2>*)s)

std::string f_代码构建_Vec2_1D插座_类型转换为新变量(C_插座基类& socket, C_节点树* rt, std::string& 新变量名称);




